#include <iostream>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <unordered_map>
using namespace std;
const int N=25;
int v[N],u[N];

int main(){
    int t,n;
    cin >> t;
    while(t--){
        cin >>n;
        memset(v,0,sizeof(v));
        int sum=0;
        for(int i=0;i<n;i++){
            cin >> v[i];
            sum+=v[i];
        }
        unordered_map<int,int> mp;
        for(int i=0,pre=0;i<n;i++){
            pre+=v[i];
            mp[pre]=i;
        }
        int f=1;
        for(int k=1;k<=n&&f;k++)
        for(int i=0,pre=0;i<n;i++){
            pre+=v[i];
            if(mp.find(pre-k)==mp.end()){
                f=0;
                break;
            }
        }
      
        if(f){
            cout << "Yes" <<endl;
        }else{
            cout << "No" <<endl;
        }
    }
    return 0;
}